﻿using BCCommon.TMS.RedPacket;
using BCEntity.TMS.RedPacket.RedPacket;
using BCEntity.TMS.RedPacket.RedPacketStatistics;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.RedPacket.RedPacket
{
    public interface IRedPacketData
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">红包</param>
        /// <returns></returns>
        Task<RedPacketEntity> InsertAsync(RedPacketEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">红包</param>
        /// <returns></returns>
        Task<RedPacketEntity> UpdateAsync(RedPacketEntity entity);
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="redPacketId">红包Id</param>
        /// <returns></returns>
        Task<RedPacketEntity> GetSingle(long redPacketId);
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="isEnabled"></param>
        /// <returns></returns>
        Task<IEnumerable<RedPacketEntity>> GetList(bool? isEnabled, long agentRecordId);
        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="isEnabled"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<RedPacketEntity>, int)> Query(bool? isEnabled, int pageIndex, int pageSize);
        /// <summary>
        /// 获取红包数量
        /// </summary>
        /// <returns></returns>
        Task<RedPacketCountEntity> GetRedPacketCount(long agentRecordId);
        /// <summary>
        /// 获取红包数量
        /// </summary>
        /// <returns></returns>
        Task<RedPacketEntity> GetRedPacket(decimal redPacketAmount, long agentRecordId);
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="isEnabled"></param>
        /// <returns></returns>
        Task<IEnumerable<RedPacketEntity>> GetRemainList(bool? isEnabled, long agentRecordId, GrundlagenTypeEnum grundlagenType);
        /// <summary>
        /// 获取红包
        /// </summary>
        /// <param name="redPacketId">红包id</param>
        /// <returns></returns>
        Task<RedPacketEntity> Receive(long redPacketId);
        /// <summary>
        /// 获取红包统计
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="grundlagenType">注册方式</param>
        /// <returns></returns>
        Task<RedPacketAgentStatisticsEntity> GetRedPacketAgentStatistics(long agentRecordId, GrundlagenTypeEnum? grundlagenType);
    }
}
